
#ifndef	MEMORY_LOOKASIDE_H
#define	MEMORY_LOOKASIDE_H


#include "slist.h"


namespace	memory
{
	class	lookaside
	{
	public:

		lookaside();
		~lookaside();

		bool			create( size_t count, unsigned short max );
		void			destroy();

		bool			push( size_t idx, SLIST_ENTRY* entry );

		SLIST_ENTRY*	pop( size_t idx );
		SLIST_ENTRY*	pop_all( size_t idx );

		size_t			size()	const;

	private:

		common::slist*	at( size_t idx )	const;

	private:

		common::slist*	slists_;
		size_t			count_;

	};
}



#endif